// src/utils/ossConfig.js
/**
 * OSS相关配置常量
 */
export const OSS_CONFIG = {
  // OSS基础域名
  baseUrl: 'https://sfzy-syf.oss-cn-hangzhou.aliyuncs.com',
  // 上传接口基础地址
  uploadUrl: 'http://localhost:8080'
};

// 封装获取完整图片URL的工具函数
export const getOssImageUrl = (relativePath) => {
  if (!relativePath) return '';
  const path = relativePath.startsWith('/') ? relativePath.slice(1) : relativePath;
  return `${OSS_CONFIG.baseUrl}/${path}`;
};

// 封装获取上传接口完整地址的函数
export const getUploadUrl = (path = 'upload') => {
  return `${OSS_CONFIG.uploadUrl}/${path}`;
};